﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>中国铁塔油机管理系统-@ViewBag.Title</title>
    <link href="~/Content/css/aui.css" rel="stylesheet" />
    <link href="~/Content/css/Common.css" rel="stylesheet" />
    <link href="~/Content/css/weui.1.1.2min.css" rel="stylesheet" />
    <link href="~/Content/css/swiper.min.css" rel="stylesheet" />
    @*<link href="~/Content/css/jquery-weui.css" rel="stylesheet" />*@
    <script src="~/Content/script/jquery-3.3.1.min.js"></script>
    <script src="~/Content/script/api.js"></script>
    <script src="~/Content/script/aui-toast.js"></script>
    <script src="~/Content/script/aui-dialog.js"></script>
    <script src="~/Content/wapUI.js"></script>
    <script src="~/Content/script/weui1.1.3.min.js"></script>
    @*<script src="~/Content/script/jquery-weui.min.js"></script>*@
    <style>



        .aui-bar-tab {
            background-color: #34495e;
        }

            .aui-bar-tab .aui-bar-tab-item {
                height: 0rem;
            }

        #footer {
            height: 55px;
        }

        .colorTab {
            color: #04BE02;
        }
    </style>
</head>
<body>
    <div id="wrap">   
        @RenderBody()
    </div>


    @*<div id="footerDiv" class="weui-tabbar aui-hide" >*@
    <div id="footerDiv" class="weui-tabbar aui-hide">
        <a href="/Home/Menu" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="~/Content/image/Home/1.png" alt="">
            </div>
            <p class="weui-tabbar__label" data-url="/Home/Menu">首页</p>
        </a>
        <a href="/Generator/Index" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="~/Content/image/Home/2.png" alt="">
            </div>
            <p class="weui-tabbar__label" data-url="/Generator/Index">油机管理</p>
        </a>
        <a href="javascript:void(0);" class="weui-tabbar__item" onclick="selectAnn()">
            <div class="weui-tabbar__icon">
                @*<img src="~/Content/image/icon_nav_msg.png" alt="">*@
                <img src="~/Content/image/Home/3.png" alt="">
            </div>
            <p class="weui-tabbar__label" data-url="/AnnouceList/Index">工单管理</p>
        </a>
        @*<a href="/Alarm/Index" class="weui-tabbar__item" >
                <div class="weui-tabbar__icon">
                    <img src="~/Content/image/icon_nav_button.png" alt="">
                </div>
                <p class="weui-tabbar__label" data-url="/Alarm/Index">告警信息</p>
            </a>


            <a href="/Information/Index" class="weui-tabbar__item " >
                <div class="weui-tabbar__icon">
                    <img src="~/Content/image/icon_nav_article.png" alt="">
                </div>
                <p class="weui-tabbar__label" data-url="/Information/Index">指标通报</p>
            </a>*@
        <a href="/User/Center" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="~/Content/image/Home/4.png" alt="">
            </div>
            <p class="weui-tabbar__label " data-url="/User/Center">个人信息</p>
        </a>
    </div>
</body>
</html>
<script src="~/Content/script/jquery-weui.min.js"></script>
<script>
    var winHeight, winWidth;
    winHeight = window.innerHeight;
    winWidth = window.innerWidth;
    footerHeiht = 55;
    //var urls = document.location.toString().split("/");
    ////如果URL包含Index则显示底部TabBar按钮
    //if (urls[urls.length - 1].toString().toUpperCase() === "INDEX") {
    //    $("#footer").removeClass('aui-hide');
    //    winHeight = winHeight - footerHeiht+1;
    //    $("#wrap").css('height', winHeight + 'px');
    //}
    $(function () {
        //设置窗口尺寸
        $("#wrap").css('height', winHeight + 'px');

        var urls = document.location.toString().split("/");
        //var a = urls[urls.length - 1].toString().toUpperCase();
        //var b = urls[urls.length - 2].toString().toUpperCase();
        //if (((urls[urls.length - 1].toString().toUpperCase() == "INDEX") && (urls[urls.length - 2].toString().toUpperCase() == "ANNOUCELIST")) || (urls[urls.length - 1].toString().toUpperCase() == "CENTER") && (urls[urls.length - 2].toString().toUpperCase() == "USER"))
        //{
        //    $("#footerDiv").removeClass('aui-hide');
        //}
        ////九宫格
        //if ((urls[urls.length - 1].toString().toUpperCase() == "MENU")) {
        //    $("#footerDiv").removeClass('aui-hide');
        //}
        //console.log(urls[urls.length - 1].toString().toUpperCase())
        if ((urls[urls.length - 1].toString().toUpperCase() == "INDEX") || (urls[urls.length - 1].toString().toUpperCase() == "MENU") || (urls[urls.length - 1].toString().toUpperCase() == "CENTER")) {
            $("#footerDiv").removeClass('aui-hide');
        }

        //if ($.contains(("AnnouceList/Index"),urls)) {
        //    $("#footerDiv").removeClass('aui-hide');
        //}
        //if (urls.indexOf("Home/Login"))
        //{

        //    $("#footerDiv").addClass('aui-hide');
        //}
        //底部按钮单击事件后,需要设置相关按钮激活样式
        $(".weui-tabbar__label").each(function () {
            if ($(this).data('url') === window.location.pathname) {
                $(this).addClass("colorTab");
            }
        });
    });

    //工单管理根据权限 选择不同工单列表
    //获取用户信息  子系统管理员 可以看 工单列表 铁塔审核 运营商审核
    //             运营商权限可以看 工单列表  运营商审核
    // 除此之外页面跳转到工单列表
    function selectAnn() {
        var html = "<a href=\"/AnnouceList/Index\" class=\"weui-btn weui-btn_primary\">工单列表</a>";
        var ck = false;
        $.ajax({
            url: "/api/Info/GetUser",
            type: "get",
            success: function (data) {
                
                if (data.StatusCode == 200) {
                    if (data.Data.RoleCode == "subadmin") {
                        html += "<a href=\"/AnnouceAudit/Index\" class=\"weui-btn weui-btn_primary\">铁塔审核</a>";
                        html += "<a href=\"/AnnounceTeleAudit/Index\" class=\"weui-btn weui-btn_primary\">运营商审核</a>"
                        ck = true;
                    }
                    if (data.Data.RoleCode == "ChinaMobileMonitor" || data.Data.RoleCode == "ChinaUnicomMonitor" || data.Data.RoleCode == "ChinaTelcomMonitor") {
                        html += "<a href=\"/AnnounceTeleAudit/Index\" class=\"weui-btn weui-btn_primary\">运营商审核</a>"
                        ck = true;
                    }
                    if (ck) {
                        $.modal({
                            title: "",
                            text: html,
                            buttons: [
                                { text: "取消", className: "default" },
                            ]
                        });
                    }
                    else {
                        location.href = "/AnnouceList/Index";
                    }

                }
                else {
                    location.href = "/AnnouceList/Index";
                }

            },
            error: function () {

                location.href = "/AnnouceList/Index";
            }
        })

        //$.modal({
        //    title: "",
        //    text: "<a href=\"/AnnouceList/Index\" class=\"weui-btn weui-btn_primary\">工单列表</a>" +
        //              "<a href=\"/AnnouceAudit/Index\" class=\"weui-btn weui-btn_primary\">铁塔审核</a>" +
        //              "<a href=\"javascript:;\" class=\"weui-btn weui-btn_primary\">运营商审核</a>",
        //    buttons: [

        //      { text: "取消", className: "default" },
        //    ]
        //});

    }
</script>
<!--weui弹出框样式 没有这个样式点取消会出问题 -->
<style>
    .weui-dialog,
    .weui-toast {
        -webkit-transition-duration: .2s;
        transition-duration: .2s;
        opacity: 0;
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        -webkit-transform-origin: 0 0;
        transform-origin: 0 0;
        visibility: hidden;
        margin: 0;
        top: 45%;
        z-index: 2000;
    }

        .weui-dialog .weui-dialog__btn.default,
        .weui-toast .weui-dialog__btn.default {
            color: #5f646e;
        }

        .weui-dialog .weui-dialog__btn + .weui-dialog__btn,
        .weui-toast .weui-dialog__btn + .weui-dialog__btn {
            position: relative;
        }

            .weui-dialog .weui-dialog__btn + .weui-dialog__btn:after,
            .weui-toast .weui-dialog__btn + .weui-dialog__btn:after {
                content: " ";
                position: absolute;
                left: 0;
                top: 0;
                width: 1px;
                height: 100%;
                border-left: 1px solid #D5D5D6;
                color: #D5D5D6;
                -webkit-transform-origin: 0 0;
                transform-origin: 0 0;
                -webkit-transform: scaleX(0.5);
                transform: scaleX(0.5);
            }

        .weui-dialog.weui-dialog--visible,
        .weui-toast.weui-dialog--visible,
        .weui-dialog.weui-toast--visible,
        .weui-toast.weui-toast--visible {
            opacity: 1;
            visibility: visible;
        }

    .weui-mask {
        opacity: 0;
        -webkit-transition-duration: .3s;
        transition-duration: .3s;
        visibility: hidden;
    }

        .weui-mask.weui-mask--visible {
            opacity: 1;
            visibility: visible;
        }
</style>
@*<link href="~/Content/css/jquery-weui.css" rel="stylesheet" />*@